package com.shuai.dynamicProxy.jdk;

import com.shuai.dynamicProxy.jdk.proxy.JdkDynamicProxyFactory;
import com.shuai.dynamicProxy.jdk.proxy.UserServiceInvocationHandler;
import com.shuai.staticProxy.service.UserService;

import java.lang.reflect.InvocationHandler;
import java.util.ArrayList;

/**
 * @author shuaihong-coding
 * @date 2025/10/3
 * @className JdkDynamicProxyMain
 */
public class JdkDynamicProxyMain {

    public static void main(String[] args){

        UserService userServiceProxy = JdkDynamicProxyFactory.getProxy(UserService.class,new UserServiceInvocationHandler());
        String userInfo = userServiceProxy.getUserInfo("帅宏");
        System.out.println(userInfo);
        ArrayList<String> userList = new ArrayList<>();
        userList.add("帅");
        userList.add("小米");
        userList.add("小白");
        String userAll = userServiceProxy.getUserAll(userList);
        System.out.println(userAll);
    }

}
